<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.solution.common.config.PublicConfig" %>
<%@page import="com.solution.admin.home.constants.IndexConstants"%>
<%
	String basePath = PublicConfig.ROOT_PATH;
	String imgRootURL = PublicConfig.IMG_ROOT_URL; //阿里云图片显示域名
	String ossImgZoomPC = PublicConfig.OSS_IMG_ZOOM_PC; //PC图片缩放规则
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<!-- 360 双核浏览器设置默认模式 -->
<!-- 
若页面需默认用极速核，增加标签: <meta name=”renderer” content=”webkit” /> 
若页面需默认用ie兼容内核，增加标签：<meta name=”renderer” content=”ie-comp” /> 
若页面需默认用ie标准内核，增加标签：<meta name=”renderer” content=”ie-stand” />  
-->
<!-- 使国内浏览器默认使用极速模式浏览 -->
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 

<!-- 网站图标@xu_cc -->
<link rel="icon" href="<%=basePath%>/statics/images/jx.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<%=basePath%>/statics/images/jx.ico" type="image/x-icon" />
<link rel="bookmark" href="<%=basePath%>/statics/images/jx.ico" type="image/x-icon" />

<!-- 引入CSS -->
<link rel="stylesheet" type="text/css" href="<%=basePath%>/statics/css/style.css?v=20180424_v1" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>/statics/css/public.css?v=20180115" />
<!-- icheck -->
<link rel="stylesheet" href="<%=basePath%>/statics/plugins/iCheck/skins/square/green.css" />
<!-- 引入JS -->
<!-- jQuery -->
<%-- <script type="text/javascript" src="<%=basePath %>/statics/js/jquery-1.6.min.js"></script> --%>
<script charset="utf-8" language="javascript" type="text/javascript" src="<%=basePath%>/statics/js/jquery.1.11.3.min.js"></script>
<!-- icheck -->
<script type="text/javascript" src="<%=basePath%>/statics/plugins/iCheck/icheck.js"></script>

<!-- 引入jstl标签库 -->
<%@ taglib prefix="jx" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!-- root -->
<script type="text/javascript">
//系统域名 
var rootPath = '<%=basePath %>';
// 系统上传文件展示域名
var imgRootURL = '<%=imgRootURL %>';
// PC图片缩放
var ossImgZoomPC = '<%=ossImgZoomPC %>';
// 百度富文本框根路径
window.UEDITOR_HOME_URL = rootPath + "/statics/plugins/ueditor/";
</script>

<c:set var="rootPath" value="<%=basePath %>"></c:set>
<c:set var="imgRootURL" value="<%=imgRootURL %>"></c:set>
<c:set var="ossImgZoomPC" value="<%=ossImgZoomPC %>"></c:set>

<script type="text/javascript">
/**
 * 点击品牌，重新加载子分类
 * @Description do-something
 * @author xu_cc
 * @date 创建时间：2018年3月5日 下午5:11:39
 * @param categoryId
 */
function reloadCategory(categoryId) {
	var brandIdStr = '';
	var labelArr = $(".brand_ul_" + categoryId + " label.checked");
	if(labelArr && labelArr.length > 0) {
		for (var i = 0; i < labelArr.length; i++) {
			brandIdStr += labelArr[i].title + ",";
		}
	}
	$.ajax({
		type: 'POST',
		url: rootPath + "/pc/getCategoryList",
		async: true,
		dataType: 'json',
		data: {
			parentCategoryId : categoryId,
			brandCodeStr : brandIdStr
		},
		success: function(json) {
			if(json && json.length > 0) {
				$(".xz_part .temp_ul_" + categoryId).html('');
				var subCategoryHtm = '';
				for(var i = 0;i < json.length; i ++ ) {
					subCategoryHtm += '<li id="categoryLi_' + categoryId + '_' + json[i].id + '" onclick="javascript: doLiLabel(\'categoryLi_' + categoryId + '_' + json[i].id + '\');"><input type="checkbox" value="' + json[i].id + '" /><label id="' + categoryId + '" title="' + json[i].id + '"><i></i><span>' + json[i].categoryName + '</span></label></li>';
				}
				$(".xz_part .temp_ul_" + categoryId).html(subCategoryHtm);
			}
		}
	});
}
 

/**
 * 选中、取消选中（品牌、分类）
 */
function doLiLabel(tagLiId) {
	// var categoryId = $(this).attr('id');
	if($("#" + tagLiId).hasClass('checked')) {
		$("#" + tagLiId + ' label').removeClass('checked');
		$("#" + tagLiId + ' input').removeClass('checked');
		$("#" + tagLiId).removeClass('checked');
	} else {
		$("#" + tagLiId + ' label').addClass('checked');
		$("#" + tagLiId + ' input').addClass('checked');
		$("#" + tagLiId).addClass('checked');
	}
	var idArr = tagLiId.split('_');
	var categoryId = idArr[1];
	if(categoryId) {
		var checkedLabelArr = $(".categoryDiv_" + categoryId + " label.checked");
		if (checkedLabelArr && checkedLabelArr.length > 0) {
			$("#btnBrandCategorySearch_" + categoryId).css('background-color', '#E74649');
		} else {
			$("#btnBrandCategorySearch_" + categoryId).css('background-color', 'gray');
		}
	}
}
</script>

